package mhe.mgt.daos;

import java.util.List;
import java.util.Map;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

public interface GenericDAO {
	
	public SessionFactory getSessionFactory();
	
	public void close(Session session);
	
	public void add(Object entity);

	public void update(Object entity);

	public Object merge(Object entity);

	public void delete(Object entity);

	public List<?> list(Class<?> objectClass);

	public Object find(Class<?> objectClass, long id);

	public List<?> list(Class<?> objectClass, String[] fields, Object[] values, boolean andCompare,
			Map<String, Boolean> sortFields, int start, int length);

	public List<?> executeQuery(String sql, Object[] values, int start, int length);
	

	public List<?> list(Class<?> objectClass, String[] field, Object[] value, boolean andCompare,
			Map<String, Boolean> sortFields, int start, int length, String loadField);

	public void executeSQLQuery(String sql, Object[] values);
	
	public void shutDown();
}
